#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/9/6 11:11
# @File           : vendor
# @IDE            : PyCharm
# @desc           : 描述

from typing import Optional
from pydantic import BaseModel, ConfigDict, Field
from core.data_types import DatetimeStr


class SampleGroup(BaseModel):
    group_name: str

    min_value: Optional[int] = None
    max_value: Optional[int] = None

    value: int = None

    create_user: Optional[str] = None
    update_user: Optional[str] = None

    is_active: Optional[bool] = True


class SampleGroupSimpleOut(SampleGroup):
    model_config = ConfigDict(from_attributes=True)

    id: int

    create_user: Optional[str] = None
    update_user: Optional[str] = None

    update_datetime: DatetimeStr
    create_datetime: DatetimeStr


class SampleGroupOptionsOut(BaseModel):
    model_config = ConfigDict(from_attributes=True)

    value: str = Field(alias="group_name")
    label: str = Field(alias="group_name")


class SampleStandard(BaseModel):
    standard: str
    group_name: str

    is_active: bool = True

    create_user: Optional[str] = None
    update_user: Optional[str] = None


class SampleStandardSimpleOut(SampleStandard):
    model_config = ConfigDict(from_attributes=True)

    id: int

    create_user: Optional[str] = None
    update_user: Optional[str] = None

    update_datetime: DatetimeStr
    create_datetime: DatetimeStr
